package org.mathcloud.math.core.generic.operator.trigonometry;

import org.mathcloud.math.core.common.operator.trigonometry.Arccoth;
import org.mathcloud.math.core.common.quantity.RealNumber;
import org.mathcloud.math.core.generic.operator.GenericUnaryOperator;
import org.mathcloud.math.core.generic.quantity.GenericRealNumber;

public class GenericArccoth extends GenericUnaryOperator implements Arccoth
{
	public GenericArccoth()
	{
		super();
		signature.setMMLContentTag("arccoth");
	}

	@Override
	public void calculate()
	{
		Double d;
		if (operand.getSignature().isRealNumberSignature()) {
			d= ((RealNumber)operand).getValue();
			res = new GenericRealNumber(Math.log((d+1.0)/(d-1.0))/2.0);
		}
	}
}